.class Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/OpenEvent;
.super Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidEvent;
.source "OpenEvent.java"


# static fields
.field static final EVENT_ID:I = 0x1

.field private static final LOG:Lcom/burstly/lib/util/LoggerExt;

.field private static final TAG:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 33
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/OpenEvent;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 38
    const-class v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/OpenEvent;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/OpenEvent;->TAG:Ljava/lang/String;

    return-void
.end method

.method constructor <init>()V
    .locals 0

    .prologue
    .line 29
    invoke-direct {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidEvent;-><init>()V

    return-void
.end method


# virtual methods
.method fireEvent(Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;[Ljava/lang/Object;)V
    .locals 8
    .parameter "mraidView"
    .parameter "args"

    .prologue
    const/4 v6, 0x1

    const/4 v7, 0x0

    .line 46
    if-eqz p2, :cond_0

    array-length v3, p2

    if-lt v3, v6, :cond_0

    aget-object v3, p2, v7

    instance-of v3, v3, Ljava/lang/String;

    if-eqz v3, :cond_0

    aget-object v3, p2, v7

    :goto_0
    check-cast v3, Ljava/lang/String;

    move-object v2, v3

    check-cast v2, Ljava/lang/String;

    .line 47
    .local v2, url:Ljava/lang/String;
    if-nez v2, :cond_1

    .line 48
    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/OpenEvent;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v4, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/OpenEvent;->TAG:Ljava/lang/String;

    const-string v5, "Url is null. Skipped."

    new-array v6, v7, [Ljava/lang/Object;

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 63
    :goto_1
    return-void

    .line 46
    .end local v2           #url:Ljava/lang/String;
    :cond_0
    const/4 v3, 0x0

    goto :goto_0

    .line 51
    .restart local v2       #url:Ljava/lang/String;
    :cond_1
    iget-object v3, p1, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->mRichMediaListener:Lcom/burstly/lib/component/networkcomponent/burstly/html/IRichMediaAdListener;

    if-eqz v3, :cond_2

    .line 52
    iget-object v3, p1, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->mRichMediaListener:Lcom/burstly/lib/component/networkcomponent/burstly/html/IRichMediaAdListener;

    invoke-interface {v3, v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/IRichMediaAdListener;->onClick(Ljava/lang/String;)V

    goto :goto_1

    .line 54
    :cond_2
    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v4, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->TAG:Ljava/lang/String;

    const-string v5, "Executing \'openUrlExternal\' {0}"

    new-array v6, v6, [Ljava/lang/Object;

    aput-object v2, v6, v7

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 56
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string v3, "android.intent.action.VIEW"

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v4

    invoke-direct {v1, v3, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 57
    .local v1, intent:Landroid/content/Intent;
    invoke-virtual {p1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 59
    .end local v1           #intent:Landroid/content/Intent;
    :catch_0
    move-exception v0

    .line 60
    .local v0, anfe:Ljava/lang/Exception;
    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v4, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->TAG:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v5

    new-array v6, v7, [Ljava/lang/Object;

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_1
.end method
